/** * <copyright> * </copyright> * * $Id$ */ package at.bestsolution.e4.addressbook.model.addressbook.impl; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import at.bestsolution.e4.addressbook.model.addressbook.Address; import at.bestsolution.e4.addressbook.model.addressbook.AddressBook; import at.bestsolution.e4.addressbook.model.addressbook.AddressType; import at.bestsolution.e4.addressbook.model.addressbook.AddressbookFactory; import at.bestsolution.e4.addressbook.model.addressbook.AddressbookPackage; import at.bestsolution.e4.addressbook.model.addressbook.Country; import at.bestsolution.e4.addressbook.model.addressbook.FederalState; import at.bestsolution.e4.addressbook.model.addressbook.Person; /** * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- * end-user-doc --> * * @generated */ public class AddressbookPackageImpl extends EPackageImpl implements AddressbookPackage { /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass addressBookEClass = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass personEClass = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass addressEClass = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass countryEClass = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass federalStateEClass = null; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EEnum addressTypeEEnum = null; /** * Creates an instance of the model <b>Package</b>, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the * package package URI value. * <p> * Note: the correct way to create the package is via the static factory * method {@link #init init()}, which also performs initialization of the * package, or returns the registered package, if one already exists. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @see org.eclipse.emf.ecore.EPackage.Registry * @see at.bestsolution.e4.addressbook.model.addressbook.AddressbookPackage#eNS_URI * @see #init() * @generated */ private AddressbookPackageImpl() { super(eNS_URI, AddressbookFactory.eINSTANCE); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private static boolean isInited = false; /** * Creates, registers, and initializes the <b>Package</b> for this model, * and for any others upon which it depends. * * <p> * This method is used to initialize {@link AddressbookPackage#eINSTANCE} * when that field is accessed. Clients should not invoke it directly. * Instead, they should simply access that field to obtain the package. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static AddressbookPackage init() { if (isInited) return (AddressbookPackage) EPackage.Registry.INSTANCE .getEPackage(AddressbookPackage.eNS_URI); // Obtain or create and register package AddressbookPackageImpl theAddressbookPackage = (AddressbookPackageImpl) (EPackage.Registry.INSTANCE .get(eNS_URI) instanceof AddressbookPackageImpl ? EPackage.Registry.INSTANCE .get(eNS_URI) : new AddressbookPackageImpl()); isInited = true; // Create package meta-data objects theAddressbookPackage.createPackageContents(); // Initialize created meta-data theAddressbookPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theAddressbookPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(AddressbookPackage.eNS_URI, theAddressbookPackage); return theAddressbookPackage; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EClass getAddressBook() { return addressBookEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getAddressBook_Persons() { return (EReference) addressBookEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getAddressBook_Countries() { return (EReference) addressBookEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EClass getPerson() { return personEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getPerson_Addresses() { return (EReference) personEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getPerson_Firstname() { return (EAttribute) personEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getPerson_Lastname() { return (EAttribute) personEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getPerson_AddressBook() { return (EReference) personEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EClass getAddress() { return addressEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getAddress_Street() { return (EAttribute) addressEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getAddress_Zip() { return (EAttribute) addressEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getAddress_City() { return (EAttribute) addressEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getAddress_Country() { return (EReference) addressEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getAddress_FederalState() { return (EReference) addressEClass.getEStructuralFeatures().get(4); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getAddress_Type() { return (EAttribute) addressEClass.getEStructuralFeatures().get(5); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getAddress_Person() { return (EReference) addressEClass.getEStructuralFeatures().get(6); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EClass getCountry() { return countryEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getCountry_FederalStates() { return (EReference) countryEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getCountry_Name() { return (EAttribute) countryEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getCountry_AddressBook() { return (EReference) countryEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EClass getFederalState() { return federalStateEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EAttribute getFederalState_Name() { return (EAttribute) federalStateEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EReference getFederalState_Country() { return (EReference) federalStateEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EEnum getAddressType() { return addressTypeEEnum; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public AddressbookFactory getAddressbookFactory() { return (AddressbookFactory) getEFactoryInstance(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private boolean isCreated = false; /** * Creates the meta-model objects for the package. This method is guarded to * have no affect on any invocation but its first. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features addressBookEClass = createEClass(ADDRESS_BOOK); createEReference(addressBookEClass, ADDRESS_BOOK__PERSONS); createEReference(addressBookEClass, ADDRESS_BOOK__COUNTRIES); personEClass = createEClass(PERSON); createEReference(personEClass, PERSON__ADDRESSES); createEAttribute(personEClass, PERSON__FIRSTNAME); createEAttribute(personEClass, PERSON__LASTNAME); createEReference(personEClass, PERSON__ADDRESS_BOOK); addressEClass = createEClass(ADDRESS); createEAttribute(addressEClass, ADDRESS__STREET); createEAttribute(addressEClass, ADDRESS__ZIP); createEAttribute(addressEClass, ADDRESS__CITY); createEReference(addressEClass, ADDRESS__COUNTRY); createEReference(addressEClass, ADDRESS__FEDERAL_STATE); createEAttribute(addressEClass, ADDRESS__TYPE); createEReference(addressEClass, ADDRESS__PERSON); countryEClass = createEClass(COUNTRY); createEReference(countryEClass, COUNTRY__FEDERAL_STATES); createEAttribute(countryEClass, COUNTRY__NAME); createEReference(countryEClass, COUNTRY__ADDRESS_BOOK); federalStateEClass = createEClass(FEDERAL_STATE); createEAttribute(federalStateEClass, FEDERAL_STATE__NAME); createEReference(federalStateEClass, FEDERAL_STATE__COUNTRY); // Create enums addressTypeEEnum = createEEnum(ADDRESS_TYPE); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private boolean isInitialized = false; /** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes // Initialize classes and features; add operations and parameters initEClass(addressBookEClass, AddressBook.class, "AddressBook", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getAddressBook_Persons(), this.getPerson(), this.getPerson_AddressBook(), "persons", null, 0, -1, AddressBook.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAddressBook_Countries(), this.getCountry(), null, "countries", null, 0, -1, AddressBook.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getPerson_Addresses(), this.getAddress(), this.getAddress_Person(), "addresses", null, 0, -1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getPerson_Firstname(), ecorePackage.getEString(), "firstname", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getPerson_Lastname(), ecorePackage.getEString(), "lastname", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getPerson_AddressBook(), this.getAddressBook(), this.getAddressBook_Persons(), "addressBook", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAddress_Street(), ecorePackage.getEString(), "street", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAddress_Zip(), ecorePackage.getEString(), "zip", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAddress_City(), ecorePackage.getEString(), "city", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAddress_Country(), this.getCountry(), null, "country", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAddress_FederalState(), this.getFederalState(), null, "federalState", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAddress_Type(), this.getAddressType(), "type", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAddress_Person(), this.getPerson(), this.getPerson_Addresses(), "person", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(countryEClass, Country.class, "Country", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getCountry_FederalStates(), this.getFederalState(), this.getFederalState_Country(), "federalStates", null, 0, -1, Country.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getCountry_Name(), ecorePackage.getEString(), "name", null, 0, 1, Country.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getCountry_AddressBook(), this.getAddressBook(), null, "addressBook", null, 0, 1, Country.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(federalStateEClass, FederalState.class, "FederalState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFederalState_Name(), ecorePackage.getEString(), "name", null, 0, 1, FederalState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getFederalState_Country(), this.getCountry(), this.getCountry_FederalStates(), "country", null, 0, 1, FederalState.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize enums and add enum literals initEEnum(addressTypeEEnum, AddressType.class, "AddressType"); addEEnumLiteral(addressTypeEEnum, AddressType.PRIVATE); addEEnumLiteral(addressTypeEEnum, AddressType.BUSINESS); addEEnumLiteral(addressTypeEEnum, AddressType.DELIVERY); // Create resource createResource(eNS_URI); } } // AddressbookPackageImpl